use actix_web::web;
use actix_web::web::ServiceConfig;

use crate::handlers::auth_handler;

pub fn auth_routes(cfg: &mut ServiceConfig) {
    cfg.service( web::scope("/auth").service(
        web::resource("")
            .route(web::post().to(auth_handler::auth_login_handler))
            .route(web::delete().to(auth_handler::logout))
            .route(web::get().to(auth_handler::get_me))
    ));
}

pub fn register_routes(cfg: &mut ServiceConfig) {
    cfg.service(web::scope("/register")
            .route("", web::post().to(auth_handler::user_register))
        );
}